Ektron CMS400.Net Reference

>>Introduction

Plug-in Extension

Introduction

Best Practice

Beginning with Version 8.0, Ektron recommends using the CMS Extensions described in the previous chapter rather than the Plug-In Extension described here. Customizing CMS Behavior with Extensions.

The Plug-in Extension exposes event hooks in Ektron CMS400.NET. As a developer, you can utilize these event hooks in Visual Studio C# or VB.NET to create customized events for your site. For instance, you could create a Plug-in Extension that:

sends an instant message when content is published

sends an email when content is published

filters out objectionable language from blog posts

appends HTML content when it’s published

How a Plug-in Works with Ektron CMS400.NET

The following example explains the way a plug-in works. This example uses the OnBeforePublish event to append HTML content with copyright information before it is published.

A content editor saves a piece of content in Ektron CMS400.NET. Before the content is published, the OnBeforePublish event is fired. The Extension Architecture checks a watch folder to see if there are any plug-ins that have the OnBeforePublish event. The Extension Architecture sees the OnBeforePublish event and executes the code. The content is then appended with the copyright information and published.

The Plug-in Extension Architecture and the Plug-in Wizard

The Plug-in Extension is comprised of two parts. The first, the Plug-in Extension Architecture, is installed on your server during the Ektron CMS400.NET install. You can control whether the Plug-in Extension Architecture is active or not by changing the ek_extensionServiceEnabled key in the Web.config. Setting this element to True activates the extension service. The key is set to True by default.

The second part, the Plug-in Extension Wizard, is installed when you run the Developer SDK install on your development system.

See Also: Installing the Developer SDK and Ektron’s Developer SDK.

This wizard creates a Plug-in Extension. In that extension is the framework code for events. All you need to do is add your custom code to the event framework. Once the code is built into a DLL, you move the DLL to the Extensions watch folder.

Managing your Plug-ins

Ektron, Inc. also provides a Plug-in Extension configuration manager to help manage and prioritize which Plug-in Extensions are executed. This configuration utility also allows you to disable or enable plug-ins, decide what should happen in the case of an unhandled error and choose which sites can use the plug-in. See Also:

Creating a Plug-in Overview

The table below provides an overview of the steps involved when creating a plug-in.

Plug-in Extension Overview Steps

See Also

1. Decide what you would like the plug-in to accomplish. For example, you want to add copyright information to each piece of HTML content that is published.

 

2. Create the plug-in extension using the Plug-in Extension Wizard in Visual Studio C# or Visual Basic.

3. Add your code to the Plug-in Extension’s framework. The Plug-in Samples section of this chapter provides samples.

4. Move the newly created Plug-in Extension DLL to the watch folder on your Ektron CMS400.NET server located at:

C:\Program Files\Ektron\Plugins\Extensions

 

5. Use the Ektron Extensibility Configuration Tool to further configure your Plug-in Extensions.

The following sections are contained in this chapter.

Installing the Developer SDK

Debugging a Plug-in

(continued in Installing the Developer SDK)


Visit the Ektron Dev Center at http://dev.ektron.com 1-866 - 4 - EKTRON

Ektron CMS400.NET Reference Version 8.02 SP1 Rev 1

Ektron Documentation,© 2011 Ektron, Inc.